{volist name="data" id="vo"}
<div class="show cbox" id="setmealShow">
    <div class="meal-info lh16">

        <p>套餐包含：</p>
        <p>{$vo.describe}</p>

    </div>
    <div class="meal-alist ssr">
        {volist name="vo.goods" id="vo2"}
        <div class="mfc fl">
            <div class="cell">
                <div class="icon">
                    <div class="sicon"><img src="{$vo2.single_pic}"></div>
                </div>
                <div class="info">
                    <h3 class="line2">{$vo2.title}</h3>
                    <!-- <p class="line5">{$vo2.describe}</p> -->
                    <!-- <p class="line5">规格:{$vo2.attr_value}<br/> 数量：{$vo2.number}
                        <br/>价格:{$vo2.price}
                    </p> -->
                    <div class="mfc prel-box fs12">
                      <p class="lh20 c-gray">规格:{$vo2.attr_value}</p>
                      <p class="lh20 c-gray">数量：{$vo2.number}<span class="fr price c-red fs14">{$vo2.price}</span></p>
                    </div>
                </div>
            </div>
        </div>
        {/volist}
    </div>

    <div class="mfc meal-option">
        {notempty name="$data" }
<!--        <button class="btnbox fr" onclick="gift_order()" data-id=""><span class="fa fa-cny"> </span> 立即下单</button>-->
        {/notempty}
        <div class="meal-info lh16" style="float:left;margin-top:6px; ">
            {if $vo.price > 0}
            <p style="color: #f00;font-size: 20px;">原价:¥ {$vo.price}</p>
            {/if}
        </div>
    </div>
</div>
{/volist}
<script>

    function gift_order() {
        var unit_id = {$data.0.unit_id};
        var type_id = {$data.0.type_id};
        var id = {$data.0.id};
        $.ajax({
            type: "POST", //用POST方式传输
            dataType: "json", //数据格式:JSON
            data:{unit_id:unit_id,type_id:type_id},
            url: "{:url('member_unit')}", //目标地址
            async: false,
            success: function (ret) {
               if(ret.code == 200){
                   window.location.href = "{:url('gift_order')}?id=" + id+'&unit_id='+unit_id+'&type_id='+type_id;
               }else{
                   layer.msg(ret.message);
               }
            }
        });


    }

</script>
